package com.stockz.equity.charting.view;

import java.awt.FlowLayout;

import javax.swing.JPanel;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.stockz.equity.charting.decorator.StockChartViewPaintTimeDecorator;
import com.stockz.equity.pattern.Parent;

@Component
public class StockChartViewControlPanel extends JPanel implements Parent {
	private static final long serialVersionUID = -1530280622636230081L;
	
	@Autowired
	private StockChartViewPaintTimeDecorator stockChartViewPaintTimeDecorator;
	private StockChartView stockChartView;
	
	public StockChartViewControlPanel(){
		setBorder(null);
		setLayout(new FlowLayout());
	}
	
	@Override
	public void validate() {
		super.validate();
		stockChartViewPaintTimeDecorator.decorate(stockChartView);
	}

	public StockChartView getStockChartView() {
		return stockChartView;
	}

	public void setStockChartView(StockChartView stockChartView) {
		this.stockChartView = stockChartView;
	}
	
}
